import { defineStore } from 'pinia'

export const useStore = defineStore('myStore', {
  state: () => ({
    // 定义存储请求数据的数组
    dataList: [],
    //宠物详情
    pet_info: {},
    //页面登录验证
    token:{},
    //用户信息
    user:{},
    //领养申请
    app_lis:[],
    //用户列表
    user_lis:[],
    //救助申请列表
    pet_in:[]
  }),
  actions: {
    // 定义用于更新数据的操作
    updateDataList(data) {
      this.dataList = data
    },
    set_Petin(data){
      this.pet_in = data
    },
    set_Userlis(data){
      this.user_lis = data
    },
    setapp(data){
      this.app_lis = data
    },
    setPet(data){
      this.pet_info = data
    },
    setTokenstring(data){
      this.token = data
    },
    removeTokenstring(){
      this.token = ""
    },
    setUser(data){
      this.user = data
    }
  }
})
